
using Youz.Common.Entity;
using Youz.Common.Helper;
using Youz.Common.DAL;
using Youz.Common.Entity;
using System;
using System.Data;
using System.Data.SqlClient;

namespace Youz.Common.BLL
{
    /// <summary>
    /// CMS_LeaveWords BLL Class
    /// </summary>
    public partial class CMS_LeaveWordsBLL : BaseBLL
    {
		CMS_LeaveWordsDAL dal;
		
        public CMS_LeaveWordsBLL()
        {
			dal = new CMS_LeaveWordsDAL();
			base.ModuleName = "CMS_LeaveWords";
            base.MenuName = "CMS_LeaveWords";
		}

        #region  成员方法
        /// <summary>
        ///  新增一条数据
        /// </summary>
        public bool Add(CMS_LeaveWords model)
        {
            var r = dal.Add(model);

            base.WriteOperationLog(OperationType.Add, r, Utility.GetJsonByObjectHaveTime(model));

            return r;
        }

        /// <summary>
        ///  保存一条数据
        /// </summary>
        public bool Update(CMS_LeaveWords model)
        {
            var r = dal.Update(model);

            base.WriteOperationLog(OperationType.Update, r, Utility.GetJsonByObjectHaveTime(model));

            return r;
        }

        /// <summary>
        /// 删除一条数据
        ///</summary>
        public bool Delete(Guid leaveWordsID)
        {
            var r = dal.Delete(leaveWordsID);
			
			base.WriteOperationLog(OperationType.Delete, r, leaveWordsID);

            return r;
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CMS_LeaveWords Get(Guid leaveWordsID)
        {
            return dal.Get(leaveWordsID);
        }
		
		/// <summary>
        /// 得到一个JSON对象
        /// </summary>
        public string GetJson(Guid leaveWordsID)
        {
            return Utility.GetJsonByObject(Get(leaveWordsID));
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet Gets(string sqlWhere)
        {
            return dal.Gets(sqlWhere);
        }
		
		/// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet Gets(int top, string sqlWhere, string filedOrder)
        {
            return dal.Gets(top, sqlWhere, filedOrder);
        }
		
		/// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string sqlWhere)
        {
            return dal.GetRecordCount(sqlWhere);
        }
		
		/// <summary>
        /// 获得数据列表分页
        /// </summary>
        public DataTable Gets(string sqlWhere, int pageindex, int pagesize, out int total, params SqlParameter[] cmdParms)
        {
            return dal.Gets(sqlWhere, pageindex, pagesize, out total, cmdParms);
        }
        #endregion  成员方法

        /// <summary>
        /// 会员留言列表
        /// </summary>
        /// <param name="memberAccount"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public DataTable GetList(string memberAccount, int pageindex, int pagesize, out int total)
        {
            return dal.GetList(memberAccount, pageindex, pagesize,out total);
        }

        /// <summary>
        /// 管理员留言列表
        /// </summary>
        /// <param name="memberAccount"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public DataTable GetList(string memberAccount, string isRead, string Status, int pageindex, int pagesize, out int total)
        {
            return dal.GetList(memberAccount,isRead,Status, pageindex, pagesize, out total);
        }
    }
}


  